package com.tbs.parkingsaleapp.UI.Listenners;

import android.content.Context;
import android.hardware.Camera;
import com.tbs.parkingsaleapp.UI.FaceTakeActivity;

public class FaceDetectionListenner  implements Camera.FaceDetectionListener {
    Context context;
    public FaceDetectionListenner(Context c)
    {
        context=c;
    }
    @Override
    public void onFaceDetection(Camera.Face[] faces, Camera camera) {
        if(faces.length>0&& FaceTakeActivity.safeToTakePicture)
        {
            camera.takePicture(null, null, new CamaraTakePicListenner(context));
            FaceTakeActivity.safeToTakePicture=false;
        }
    }
}
